package com.shenzhen.horselive.adapter;

import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.shenzhen.horselive.R;
import com.shenzhen.horselive.beans.ApplyCardBean;

import org.jetbrains.annotations.NotNull;

public class OpenCardAdapter extends BaseQuickAdapter<ApplyCardBean.DataBean, BaseViewHolder> {
    public OpenCardAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, ApplyCardBean.DataBean s) {
        TextView  textView = baseViewHolder.getView(R.id.tv_title);
        baseViewHolder.setText(R.id.tv_title,s.getSchemeTitle())
                .setText(R.id.tv_content,s.getSchemeDetails());

        int  positon = baseViewHolder.getAdapterPosition();
        if (positon%3==0)
        {
            textView.setBackground(getContext().getResources().getDrawable(R.drawable.shape_item_text0));
        }
        else if (positon%3==1)
        {
            textView.setBackground(getContext().getResources().getDrawable(R.drawable.shape_item_text));

        }else
        {
            textView.setBackground(getContext().getResources().getDrawable(R.drawable.shape_item_text2));

        }



    }
}
